home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7766 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.5 KB  |  87 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: Checking For Keyboard Input
  5. Message-ID: <1996Feb28.182012.28428@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <1176@altheim.win-uk.net>
  11. Date: Wed, 28 Feb 1996 18:20:12 GMT
  12.  
  13. In article <1176@altheim.win-uk.net>, broldham@altheim.win-uk.net (Brian R. Oldham) writes:
  14. >In article <4gqm3pINNkbu@keats.ugrad.cs.ubc.ca>, Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) writes:
  15. >>In article <cerebus.34.000DD98A@voicenet.com>,
  16. >>aLEX <cerebus@voicenet.com> wrote:
  17. >>>Hello fellow C programmers,
  18. >>
  19. >>That's a little presumptious, don't you think?
  20. >>
  21. >
  22. >Also of you to say so, Kazi.
  23. >
  24. >>>        Is there anyway to check if keyboard input has been entered without 
  25. >>>actually stalling the excution of the code until the user presses a key.  I 
  26. >>>would really like to do this but I can't seem to find any way.  If you know of 
  27. >>>a way PLEASE email me or post it.  Thank you in advance.
  28. >>
  29. >>This question comes up not fewer than 10 times a week in this newsgroup, yet it
  30. >>has nothing to do with the C language. It is more than adequatly covered in the
  31. >>FAQ, as you would know if you had read it.
  32. >>-- 
  33. >
  34. >If you had not been so preoccupied with your annoyance at aLEX's
  35. >greeting you might have answered his query - or ignored it. A simple
  36. >brief mention of kbhit() or equivalent, or a call to whatever interrupt
  37. >pauses the keyboard would have been helpful, but you may be assured,
  38. >none of us appreciate supercilious resposes such as this. Are you going
  39.                                                            ^^^^^^^^^^^^^
  40. >to post this crap *every* time a newbie asks a question?
  41.  ^^^^^^^^^^^^      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  42.  
  43. I didn't. But ... sure, why not?  :-)
  44.  
  45. It takes time to formulate an answer to a question that has been asked
  46. *many* times before, and it is a lot quicker and simpler to say:
  47. "Please look at question XX.XX in the FAQ." Which is what I do. The
  48. long and detailed answers in the FAQ would take too much time for me to
  49. write in here again - particularly in as good or error-free a way!
  50.  
  51. Yes, I do believe that the newbie ought to be directed to read the FAQ
  52. before posting. If they had done so, they would have seen the following
  53. questions (and their answers):
  54.  
  55. 19.1:   How can I read a single character from the keyboard without
  56.         waiting for the RETURN key?  How can I stop characters from
  57.         being echoed on the screen as they're typed?
  58.  
  59. 19.2:   How can I find out if there are characters available for reading
  60.         (and if so, how many)?  Alternatively, how can I do a read that
  61.         will not block if there are no characters available?
  62.  
  63. 19.3:   How can I display a percentage-done indication that updates
  64.         itself in place, or show one of those "twirling baton" progress
  65.         indicators?
  66.  
  67. 19.4:   How can I clear the screen?
  68.         How can I print things in inverse video?
  69.         How can I move the cursor to a specific x, y position?
  70.  
  71. 19.5:   How do I read the arrow keys?  What about function keys?
  72.  
  73. 19.6:   How do I read the mouse?
  74.  
  75. among other (sometimes system-specific) questions. The answers are long
  76. enough to help anybody out.
  77.  
  78.                                 Z
  79.  
  80.  
  81. -- 
  82. -------------------------------------------------------------------------
  83. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  84. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  85. -------------------------------------------------------------------------
  86.